package oo8;

import java.io.IOException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Calc {
	// 获得日志对象
	public static final Logger Log = LoggerFactory.getLogger(Calc.class);

	public int mul(int a, int b) throws Exception {
		return a * b;
	}

	int divide(int a, int b) throws Exception, IOException {
		Log.debug("准备做除法了");
		Log.info("被除数是：" + a);
		Log.info("除数是：" + b);
		try {
			int c = a / b;
			return c;
		} catch (Exception e) {
			Log.error("除法出错了", e);
			// TODO 自动生成的 catch 块
			// e.printStackTrace();
			// throw e;
			throw new MyException(e);
		}
		// return 0;
	}
}
